ARD2  1.00 for Rev B. Hardware
Airbag Reference Demonstrator using MPC5604P
Labview.h File Reference

Provides communication routines with FSL TLS Labview interface. More...

#include "Compile_Options.h"

Go to the source code of this file.

Defines

#define _LABVIEW_H
#define TRUE   (1u)
#define CLEAR   (0u)
#define BITS_IN_NIBBLE   (4u)
#define BITS_IN_BYTE   (8u)
#define BYTES_IN_16   (2u)
#define BYTES_IN_32   (4u)
#define BIT_DEFINITION
#define BIT0   (1u << 0u)
#define BIT1   (1u << 1u)
#define BIT2   (1u << 2u)
#define BIT3   (1u << 3u)
#define BIT4   (1u << 4u)
#define BIT5   (1u << 5u)
#define BIT6   (1u << 6u)
#define BIT7   (1u << 7u)
#define BIT8   (1u << 8u)
#define BIT9   (1u << 9u)
#define BIT10   (1u << 10)
#define BIT11   (1u << 11)
#define BIT12   (1u << 12)
#define BIT13   (1u << 13)
#define BIT14   (1u << 14)
#define BIT15   (1u << 15)
#define BIT16   (1u << 16)
#define BIT17   (1u << 17)
#define BIT18   (1u << 18)
#define BIT19   (1u << 19)
#define BIT20   (1u << 20)
#define BIT21   (1u << 21)
#define BIT22   (1u << 22)
#define BIT23   (1u << 23)
#define BIT24   (1u << 24)
#define BIT25   (1u << 25)
#define BIT26   (1u << 26)
#define BIT27   (1u << 27)
#define BIT28   (1u << 28)
#define BIT29   (1u << 29)
#define BIT30   (1u << 30)
#define BIT31   (1u << 31)
#define LABVIEW_SCI   (1u)
#define SIZE_OF_SOF   (5u)
#define SIZE_OF_SOF_FOR_D   (4u)
#define SIZE_OF_SOF_FOR_T   (3u)
#define LABVIEW_COMPOSITE_MESSAGE_SIZE   (256u)
#define LABVIEW_CMD_MSG_SIZE   ((uint8_t)0x04u)
#define LV_RESPONSE_TIME   ((uint8_t)0u)
#define LV_RESPONSE_CMD   ((uint8_t)4u)
#define LV_RESPONSE_ARG1   ((uint8_t)5u)
#define LV_RESPONSE_ARG2   ((uint8_t)6u)
#define LV_RESPONSE_ARG3   ((uint8_t)7u)
#define LV_RESPONSE_PASS   ((uint8_t)8u)
#define LV_RESPONSE_RESPONSE   ((uint8_t)9u)
#define LV_RESPONSE_ADDER   ((uint8_t)8u)
#define N_ELEMENTS(X)   (sizeof(X)/sizeof(*(X)))
#define LV_SEND_IN_PARALLEL   (1u)
#define LV_SEND_SERIALLY   (0u)

Enumerations

enum  SCI_START_OF_FRAME_INDEX {
  LV_MS_MSG = 0, LV_MP_MSG, LV_TI_MSG, LV_TS_MSG,
  LV_TT_MSG, LV_DA_MSG, LV_DS_MSG, LV_RS_MSG,
  LV_RR_MSG, LV_RE_MSG, LV_DD_MSG
}
enum  LABVIEW_SIZE { LV_8 = 1, LV_16, LV_24, LV_32 }
enum  LABVIEW_RX_ARRAY { LV_CMD = 0, LV_ARG1, LV_ARG2, LV_ARG3 }

Functions

void vfnDisplaySCIData (uint8_t u8Type, uint8_t u8BitSizeOfSample, uint8_t u8NOfStreams, uint16_t u16NOfSamples, uint8_t *pu8Data)
 This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI.
void vfnDisplaySCIDataParallel (uint8_t u8Type, uint8_t u8BitSizeOfSample, uint8_t u8NOfStreams, uint16_t u16NOfSamples, uint8_t *pu8Data)
 This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI, and sends data using Isrs so that its done in parallel to other code being executed.
void vfnLVTriggerEvent (const uint8_t u8Mask)
 This function will send a DD command to the Toulouse-based GUI. It shall act as an event trigger.
void vfnDisplaySCIRegistersInTable (uint8_t u8TableType, uint16_t u16InitAddress, uint16_t u16NOfData, uint8_t *pu8RegTable)
 This function will construct a data frame so that device registers can be accurately displayed using TLS's Labview GUI.
uint8_t u8fnLabViewSendMSorMP (uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Mode, uint8_t u8LabViewMsgType)
 This function will construct a data frame so that a message is shown using TLS's Labview interface.
void vfnLVMixAndMatch (uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Type)
 This function will construct either an MP or MS data frame.
void vfnLVMixAndMatchParallel (uint8_t *pu8Data, uint8_t u8Length, uint8_t u8Type)
 This function will construct either an MP or MS data frame and send it using Isrs as to allow parallel execution of code.
uint8_t u8fnLVConfigRxCmd (void)
 This routine configures the micro to receive Labview messages It should be called once at setup.
uint8_t u8fnLVReceiveCmd (void)
 This function gathers all the data in the receive buffer and constructs a message from it. Otherwise, flags it as non-existent. Result message is stored in gau8LabViewRxCmd.
void vfnLVEnable (uint8_t u8Enable)
 This function enables or disables Tx isrs, essentially pausing any pending transmission, or resuming it as necessary.
uint8_t u8fnLVWaitForTxPort (void)
 Waits for any ongoing transmission to finish.

Variables

uint8_t gau8LabViewRxCmd [LABVIEW_CMD_MSG_SIZE]

Detailed Description

Provides communication routines with FSL TLS Labview interface.

Copyright (c) 2011 Freescale Semiconductor Freescale Confidential Proprietary

Author:
Freescale Semiconductor
SASD Automotive
R11515
R20246
Version:
Date:
Warning:
(If needed)

History:


Define Documentation

#define LABVIEW_SCI   (1u)

Defines the current SCI port used by these routines

#define LV_SEND_IN_PARALLEL   (1u)

Defines for modes

#define TRUE   (1u)

Default Yes and No defines


Function Documentation

uint8_t u8fnLabViewSendMSorMP ( uint8_t *  pu8Data,
uint8_t  u8Length,
uint8_t  u8Mode,
uint8_t  u8LabViewMsgType 
)

This function will construct a data frame so that a message is shown using TLS's Labview interface.

Parameters:
pu8Data,:Pointer to the data to be displayed.
u8Length,:Length of data.
u8ModeEither LV_SEND_IN_PARALLEL or LV_SEND_SERIALLY
u8LabViewMsgTypeeither LV_MS_MSG or LV_MP_MSG
Returns:
Always CLEAR.
uint8_t u8fnLVConfigRxCmd ( void  )

This routine configures the micro to receive Labview messages It should be called once at setup.

Parameters:
None
Returns:
UART_NOT_READY in case HW is in config mode and the operation couldn't thake place; CLEAR otherwise.
uint8_t u8fnLVReceiveCmd ( void  )

This function gathers all the data in the receive buffer and constructs a message from it. Otherwise, flags it as non-existent. Result message is stored in gau8LabViewRxCmd.

Parameters:
None
Returns:
UART_NOT_READY in case HW is in config mode and the operation couldn't thake place; CLEAR otherwise.
uint8_t u8fnLVWaitForTxPort ( void  )

Waits for any ongoing transmission to finish.

Parameters:
None.
Returns:
UART_TIMEOUT if timed-out, otherwise CLEAR.
void vfnDisplaySCIData ( uint8_t  u8Type,
uint8_t  u8BitSizeOfSample,
uint8_t  u8NOfStreams,
uint16_t  u16NOfSamples,
uint8_t *  pu8Data 
)

This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI.

Parameters:
u8Type,:LV_DA_MSG or LV_DS_MSG - Data to be graphed or others
u8BitSizeOfSample,:used as an index for either 8, 16, 24, or 32 bit data per sample per stream.
u8NOfStreams,:1 - 8, number of data streams to be sent in the package
u16NOfSamples,:Per stream to be sent.
pu8Data,:pointer to where the data that is to be sent is located.
Returns:
void.
void vfnDisplaySCIDataParallel ( uint8_t  u8Type,
uint8_t  u8BitSizeOfSample,
uint8_t  u8NOfStreams,
uint16_t  u16NOfSamples,
uint8_t *  pu8Data 
)

This function will construct a data frame so that data can be accurately be displayed using TLS's Labview GUI, and sends data using Isrs so that its done in parallel to other code being executed.

Parameters:
u8Type,:LV_DA_MSG or LV_DS_MSG - Data to be graphed or others
u8BitSizeOfSample,:used as an index for either 8, 16, 24, or 32 bit data per sample per stream.
u8NOfStreams,:1 - 8, number of data streams to be sent in the package
u16NOfSamples,:Per stream to be sent.
pu8Data,:pointer to where the data that is to be sent is located.
Returns:
void.
void vfnDisplaySCIRegistersInTable ( uint8_t  u8TableType,
uint16_t  u16InitAddress,
uint16_t  u16NOfData,
uint8_t *  pu8RegTable 
)

This function will construct a data frame so that device registers can be accurately displayed using TLS's Labview GUI.

Parameters:
u8TableType,:LV_RS_MSG, LV_RR_MSG, or LV_RE_MSG.
u16InitAddress,:First address to be sent.
u16NOfData,:Size of message.
pu8RegTable,:Pointer to where the table with data is contained.
Returns:
Void.
void vfnLVEnable ( uint8_t  u8Enable)

This function enables or disables Tx isrs, essentially pausing any pending transmission, or resuming it as necessary.

Parameters:
u8Enable,:CLEAR to disable, non-zero to enable.
Returns:
void.
void vfnLVMixAndMatch ( uint8_t *  pu8Data,
uint8_t  u8Length,
uint8_t  u8Type 
)

This function will construct either an MP or MS data frame.

Parameters:
pu8Data,:Pointer to the data to be displayed.
u8Length,:Length of data.
u8Type,:either 0 or 1 for MS or MP.
Returns:
void.
void vfnLVMixAndMatchParallel ( uint8_t *  pu8Data,
uint8_t  u8Length,
uint8_t  u8Type 
)

This function will construct either an MP or MS data frame and send it using Isrs as to allow parallel execution of code.

Parameters:
pu8Data,:Pointer to the data to be displayed.
u8Length,:Length of data.
u8Type,:either 0 or 1 for MS or MP.
Returns:
void.
void vfnLVTriggerEvent ( const uint8_t  u8Mask)

This function will send a DD command to the Toulouse-based GUI. It shall act as an event trigger.

Parameters:
u8MaskMask where triggered events, from 0 to 5, are flagged in their corresponding bit.
Returns:
void.